<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>添加</title>
    <#assign base=request.contextPath  />
    <base id="base" href="${base}">
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, adminUser-scalable=0">
    <link rel="stylesheet" href="${base}/static/win10/component/layui/css/layui.css" media="all">
    <script>
        var base =  "${base}";
    </script>
</head>
<body>
<br>
<form class="layui-form " action="">
         <input type="hidden" id="id" name="id" value="${appuser.id!}" >
          <div class="layui-form-item">
              <label class="layui-form-label">名字</label>
              <div class="layui-input-block">
                  <input type="text" id="uName" name="uName" value="${appuser.uName!}"  autocomplete="off" placeholder="请输入名字"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">电话</label>
              <div class="layui-input-block">
                  <input type="text" id="phone" name="phone" value="${appuser.phone!}"  autocomplete="off" placeholder="请输入电话"
                         class="layui-input">
              </div>
          </div>
          <div class="layui-form-item">
              <label class="layui-form-label">状态 </label>
              <div class="layui-input-block">
                  <select id="state" lay-filter="state">
                      <option value="">请选择....</option>
                      <option value="0"  <#if appuser.state==0>selected</#if>    >未注册</option>
                      <option value="1" <#if appuser.state==1>selected</#if>  >审核通过</option>
                      <option value="2" <#if appuser.state==2>selected</#if>  >审核中</option>
                      <option value="3" <#if appuser.state==3>selected</#if>  >管理员</option>
                  </select>
              </div>
          </div>

    <div align="center">
        <button type="button" class="layui-btn" id="submit">保存</button>
    </div>
</form>

<script src="${base}/static/win10/component/layui/layui.js?t=1"></script>
<script src="${base}/static/win10/js/jquery-1.8.3.min.js?t=1"></script>
<script>
    layui.use(['form', 'layer'], function() {
        var form = layui.form
                , layer = layui.layer;
        $("#submit").on("click",function () {
            var formDate = {
                         id:$("#id").val(),
                         uName:$("#uName").val(),
                         phone:$("#phone").val(),
                         openid:$("#openid").val(),
                         departmentId:$("#departmentId").val(),
                         postId:$("#postId").val(),
                           state:$("#state").val()
            }
            $.ajax({
                type: "POST",
                url: base+"/app/appuser/editAppuser",
                data: formDate,
                success: function (data) {
                    layer.msg(data.message)
                    if (data.code === 200) {
                        window.location.href=base+"/app/appuser/main.html"
                    } else {

                    }
                }
            });
        })







    });

</script>
</body>
</html>